package com.easyliving.app.lib.net;

import androidx.lifecycle.Observer;

import com.easyliving.app.lib.utils.Logger;

/**
 * @Description: observer封装
 * @Author: chiboo
 */
public abstract class ResponseObserver<T> implements Observer<T> {
    Logger logger=Logger.getLogger();
    @Override
    public void onChanged(T t) {
        //logger.d("ResponseObserver %s",t);
        if(t!=null){
            onSuccess(t);
        }else{
            onFailure();
        }
    }
    public abstract void onSuccess(T t);
    public abstract void onFailure();
}
